<template>
<a-card :bordered="false" :bodyStyle="{padding:'0px'}">
  <a-tabs default-active-key="myTask" class="tab_warp">
    <a-tab-pane key="myTask">
      <span slot="tab">
        <a-icon type="user" />
        公司新闻
      </span>
      <a-table
        size="small"
        row-key="id"
        :columns="columns"
        :data-source="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      />
    </a-tab-pane>
    <a-tab-pane key="teamTask">
      <span slot="tab">
        <a-icon type="team" />
        通知公告
      </span>
      <a-table
        size="small"
        row-key="id"
        :columns="columns"
        :data-source="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      />
    </a-tab-pane>
  </a-tabs>
</a-card>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import STable from '@/components/table'
export default {
  name: 'Notice',
  components: {
    STable
  },
  mixins: [JeecgListMixin],
  data() {
    return {
      columns: [
        {
          title: '标题',
          align: 'center',
          dataIndex: 'titile'
        }, {
          title: '发布人',
          align: 'center',
          dataIndex: 'sender'
        }, {
          title: '发布时间',
          align: 'center',
          dataIndex: 'sendTime'
        },
        {
          title: '优先级',
          align: 'center',
          dataIndex: 'priority',
          customRender: function(text) {
            if (text == 'L') {
              return '低'
            } else if (text == 'M') {
              return '中'
            } else if (text == 'H') {
              return '高'
            } else {
              return text
            }
          }
        }
      ],
      url: {
        list: '/sys/sysAnnouncementSend/getMyAnnouncementSend'
      },
      ipagination: {
        current: 1,
        pageSize: 5,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' 共' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      backVisible: false,
      taskData: {},
      form: this.$form.createForm(this),
      taskTitle: ''
    }
  },
  methods: {

  }
}
</script>
